<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactDataForm.aspx.cs" Inherits="Meditek.UI.ContactDataForm" MasterPageFile="~/MasterPage.Master"%>

<%@ Register Assembly="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    Namespace="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="server">
<br />
  <asp:FormView ID="EditFormView" runat="server" DefaultMode= "Insert" DataSourceID="ContactDataDataSource"
	oniteminserting="EditFormView_ItemInserting"  onitemupdating="EditFormView_ItemUpdating" BackColor="#284775" ForeColor="WhiteSmoke" >
	<EditItemTemplate> 
    <table>

	  <tr>
        <td><asp:Label ID="lblidContactDataDisplay" runat="server" Text="id Contact Data :" /></td> 
		<td>
		  <asp:TextBox ID="txtidContactData" runat="server" Text='<%# Bind("idContactData") %>'
			ReadOnly="true"
			Width = "70px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="idContactDataValidator" runat="server" ControlToValidate="txtidContactData"
               PropertyName="idContactData" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblCelDisplay" runat="server" Text="Cel :" /></td> 
		<td>
		  <asp:TextBox ID="txtCel" runat="server" Text='<%# Bind("Cel") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="celValidator" runat="server" ControlToValidate="txtCel"
               PropertyName="Cel" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblDirectionDisplay" runat="server" Text="Direction :" /></td> 
		<td>
		  <asp:TextBox ID="txtDirection" runat="server" Text='<%# Bind("Direction") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="directionValidator" runat="server" ControlToValidate="txtDirection"
               PropertyName="Direction" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblFirstNameDisplay" runat="server" Text="First Name :" /></td> 
		<td>
		  <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="firstNameValidator" runat="server" ControlToValidate="txtFirstName"
               PropertyName="FirstName" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblLasName2Display" runat="server" Text="Las Name2 :" /></td> 
		<td>
		  <asp:TextBox ID="txtLasName2" runat="server" Text='<%# Bind("LasName2") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="lasName2Validator" runat="server" ControlToValidate="txtLasName2"
               PropertyName="LasName2" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblLastNameDisplay" runat="server" Text="Last Name :" /></td> 
		<td>
		  <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="lastNameValidator" runat="server" ControlToValidate="txtLastName"
               PropertyName="LastName" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblMailDisplay" runat="server" Text="Mail :" /></td> 
		<td>
		  <asp:TextBox ID="txtMail" runat="server" Text='<%# Bind("Mail") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="mailValidator" runat="server" ControlToValidate="txtMail"
               PropertyName="Mail" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblMiddleNameDisplay" runat="server" Text="Middle Name :" /></td> 
		<td>
		  <asp:TextBox ID="txtMiddleName" runat="server" Text='<%# Bind("MiddleName") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="middleNameValidator" runat="server" ControlToValidate="txtMiddleName"
               PropertyName="MiddleName" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	  <tr>
        <td><asp:Label ID="lblTelDisplay" runat="server" Text="Tel :" /></td> 
		<td>
		  <asp:TextBox ID="txtTel" runat="server" Text='<%# Bind("Tel") %>'
			Width = "210px" 
			TextMode="SingleLine"
			/>
			<br />
            <cc1:PropertyProxyValidator ID="telValidator" runat="server" ControlToValidate="txtTel"
               PropertyName="Tel" SourceTypeName="Meditek.Entities.ContactData"></cc1:PropertyProxyValidator>
	    </td>
      </tr>
	</table>
	</EditItemTemplate>
	<EmptyDataTemplate>
		<b>ContactData not found..!</b>
	</EmptyDataTemplate>
	<FooterTemplate>
	  <table>
		<tr>
		  <td><asp:Button ID="btnSave" runat="server"   CausesValidation="True"	CommandName="Insert" Text="Save" CssClass="Button" /></td>
 		  <td><asp:Button ID="btnUpdate" runat="server" CausesValidation="True"  CommandName="Update" Text="Save" CssClass="Button" /></td>
		  <td><asp:Button ID="btnCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Go To ContactData List" PostBackUrl="ContactDataList.aspx" CssClass="Button" /></td>
        </tr>
	  </table>
	</FooterTemplate>
    </asp:FormView>
	<asp:ObjectDataSource ID="ContactDataDataSource" runat="server" 
         SelectMethod="GetById" TypeName="Meditek.UI.ContactDataReference.ContactDataServiceClient" 
         DataObjectTypeName="Meditek.Entities.ContactData" InsertMethod="Insert"  UpdateMethod="Update"
         oninserted="ContactDataDataSource_CommitChanges" onupdated="ContactDataDataSource_CommitChanges"
         onobjectcreated="ContactDataDataSource_ObjectCreated" >
            <SelectParameters>
                <asp:QueryStringParameter Name="idContactData" QueryStringField="idContactData" />
            </SelectParameters>
    </asp:ObjectDataSource>
  </asp:Content>    
